import request from '@/config/axios'

// 年级学科 VO
export interface GradeSubjectRelationVO {
  id: number // 主键
  gradeId: number // 年级ID
  subjectId: number // 学科ID
  version: number // 版本号
}

// 年级学科 API
export const GradeSubjectRelationApi = {
  // 查询年级学科分页
  getGradeSubjectRelationPage: async (params: any) => {
    return await request.get({ url: `/common/grade-subject-relation/page`, params })
  },

  // 查询年级学科详情
  getGradeSubjectRelation: async (id: number) => {
    return await request.get({ url: `/common/grade-subject-relation/get?id=` + id })
  },

  // 新增年级学科
  createGradeSubjectRelation: async (data: GradeSubjectRelationVO) => {
    return await request.post({ url: `/common/grade-subject-relation/create`, data })
  },

  // 修改年级学科
  updateGradeSubjectRelation: async (data: GradeSubjectRelationVO) => {
    return await request.put({ url: `/common/grade-subject-relation/update`, data })
  },

  // 删除年级学科
  deleteGradeSubjectRelation: async (id: number) => {
    return await request.delete({ url: `/common/grade-subject-relation/delete?id=` + id })
  },

  // 导出年级学科 Excel
  exportGradeSubjectRelation: async (params) => {
    return await request.download({ url: `/common/grade-subject-relation/export-excel`, params })
  },
}